package com.onepower.core.modules.repository.mapper;

import com.onepower.core.modules.repository.entity.MatchScore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
  * 比赛分数表 Mapper 接口
 * </p>
 *
 * @author kin
 * @since 2018-08-12
 */
public interface MatchScoreMapper extends BaseMapper<MatchScore> {

    MatchScore selectScoreByMatchScheduleId(@Param("id") int id, @Param("matchId") int matchId);

    List<Map<String,Object>> selectScoreList(@Param("matchScheduleId") int matchScheduleId, @Param("scoreType") int scoreType);

    Map<String,Object> avgScore(@Param("matchScheduleId") int matchScheduleId,@Param("scoreType") int scoreType);

    Map<String,Object> sumScore(@Param("matchScheduleId") int matchScheduleId, @Param("scoreType") int scoreType);

    Map<String,Object> removeMaxAndMinAvgExpressiveness(@Param("matchScheduleId") int matchScheduleId, @Param("scoreType") int scoreType);

    Map<String,Object> removeMaxAndMinAvgAccuracy(@Param("matchScheduleId") int matchScheduleId, @Param("scoreType") int scoreType);

    Map<String,Object> removeMaxAndMinSumSocre(@Param("matchScheduleId") int matchScheduleId, @Param("scoreType") int scoreType);

    Integer matchScoreCount(@Param("matchScheduleId") int matchScheduleId, @Param("scoreType") int scoreType);

    Map<String,Object>  matchScoreWinnerCount(@Param("matchScheduleId") int matchScheduleId, @Param("scoreType") int scoreType);

    MatchScore matchRefereeScore(int matchScheduleId, int refereeId,@Param("scoreType") int scoreType);

    List<Map<String,Object>> selectRefereeScoreList(int matchId, int matchAdminId, int matchScheduleId,@Param("scoreType") int scoreType);

    List<Map<String,Object>> orderAccuracy(@Param("matchScheduleId") int matchScheduleId, @Param("scoreType") int scoreType);

    List<Map<String,Object>> orderExpressiveness(@Param("matchScheduleId") int matchScheduleId, @Param("scoreType") int scoreType);

    List<Map<String,Object>> orderAccuracyAll(@Param("matchScheduleId") int matchScheduleId);

    List<Map<String,Object>> orderExpressivenessAll(@Param("matchScheduleId") int matchScheduleId);

    Map<String,Object> sumScoreAll(@Param("matchScheduleId") int matchScheduleId);

}